﻿
namespace ATA.Windows.Forms
{
	/// <summary>
	/// abstract ChuongTrinhChiTiet typed datagridview
	/// </summary>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ChuongTrinhChiTietDataGridViewBase : System.Windows.Forms.UserControl
	{	
		/// <summary> 
		/// Thrown when the current Entity changed.
		/// </summary>
		public event System.EventHandler<ChuongTrinhChiTietDataGridViewEventArgs> CurrentEntityChanged;
		
		#region Fields
				
		/// <summary> 
		/// the current entity.
		/// </summary>
		private Entities.ChuongTrinhChiTiet _currentChuongTrinhChiTiet = null;
		//private Dictionary<string, string> _columnsHeaders = new Dictionary<string, string>();
		
		/// <summary> 
		/// the datagridview instance
		/// </summary>
		protected System.Windows.Forms.DataGridView uxChuongTrinhChiTietDataGridView;
		
		/// <summary> 
		/// the errorprovider
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxChuongTrinhChiTietErrorProvider;
		
		/// <summary> 
		/// the bindingsource
		/// </summary>
		protected System.Windows.Forms.BindingSource uxChuongTrinhChiTietBindingSource;
		
		
		/// <summary> 
		/// the DGV column associated with the ChiTietId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxChiTietIdDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the LoaiThoiGianId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxLoaiThoiGianIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the SoThoiGian property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxSoThoiGianDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the DoanhSo property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxDoanhSoDataGridViewColumn;
		/// <summary> 
		/// the DGV column associated with the ChuongTrinhId property
		/// </summary>
		protected System.Windows.Forms.DataGridViewComboBoxColumn uxChuongTrinhIdDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the LastUpdate property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxLastUpdateDataGridViewColumn;
		
		/// <summary> 
		/// the DGV column associated with the UpdateBy property
		/// </summary>
		protected System.Windows.Forms.DataGridViewTextBoxColumn uxUpdateByDataGridViewColumn;
		
		#endregion
					
		#region Combo list
		
				
		private Entities.TList<Entities.ChuongTrinh> _ChuongTrinhIdList;
		
		/// <summary> 
		/// The list of selectable ChuongTrinh
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.ChuongTrinh> ChuongTrinhIdList
		{
			get {return this._ChuongTrinhIdList;}
			set 
			{
				this._ChuongTrinhIdList = value;
				this.uxChuongTrinhIdDataGridViewColumn.DataSource = null;
				this.uxChuongTrinhIdDataGridViewColumn.DataSource = this._ChuongTrinhIdList;
			}
		}
		
		private bool _allowNewItemInChuongTrinhIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of ChuongTrinh
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInChuongTrinhIdList
		{
			get { return _allowNewItemInChuongTrinhIdList;}
			set
			{
				this._allowNewItemInChuongTrinhIdList = value;
				this.uxChuongTrinhIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
				
		private Entities.TList<Entities.LoaiThoiGian> _LoaiThoiGianIdList;
		
		/// <summary> 
		/// The list of selectable LoaiThoiGian
		/// </summary>
		[System.ComponentModel.Category("DropDownList BindingSources")]
		public Entities.TList<Entities.LoaiThoiGian> LoaiThoiGianIdList
		{
			get {return this._LoaiThoiGianIdList;}
			set 
			{
				this._LoaiThoiGianIdList = value;
				this.uxLoaiThoiGianIdDataGridViewColumn.DataSource = null;
				this.uxLoaiThoiGianIdDataGridViewColumn.DataSource = this._LoaiThoiGianIdList;
			}
		}
		
		private bool _allowNewItemInLoaiThoiGianIdList;
		
		/// <summary> 
		/// Indicates if user can add an item in the list of LoaiThoiGian
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInLoaiThoiGianIdList
		{
			get { return _allowNewItemInLoaiThoiGianIdList;}
			set
			{
				this._allowNewItemInLoaiThoiGianIdList = value;
				this.uxLoaiThoiGianIdDataGridViewColumn.DisplayStyle = value ? System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox : System.Windows.Forms.DataGridViewComboBoxDisplayStyle.DropDownButton;
			}
		}
		
		#endregion
		
		#region Main Datasource
		
		private Entities.TList<Entities.ChuongTrinhChiTiet> _ChuongTrinhChiTietList;
				
		/// <summary> 
		/// The list of ChuongTrinhChiTiet to be displayed in the DGV.
		/// </summary>
		[System.ComponentModel.Category("Data")]
		public Entities.TList<Entities.ChuongTrinhChiTiet> ChuongTrinhChiTietList
		{
			get {return this._ChuongTrinhChiTietList;}
			set
			{
				this._ChuongTrinhChiTietList = value;
				this.uxChuongTrinhChiTietBindingSource.DataSource = null;
				this.uxChuongTrinhChiTietBindingSource.DataSource = value;
				this.uxChuongTrinhChiTietDataGridView.DataSource = null;
				this.uxChuongTrinhChiTietDataGridView.DataSource = this.uxChuongTrinhChiTietBindingSource;				
				//this.uxChuongTrinhChiTietBindingSource.ListChanged += new System.ComponentModel.ListChangedEventHandler(uxChuongTrinhChiTietBindingSource_ListChanged);
				this.uxChuongTrinhChiTietBindingSource.CurrentItemChanged += new System.EventHandler(OnChuongTrinhChiTietBindingSourceCurrentItemChanged);
			}
		}
		
		private void OnChuongTrinhChiTietBindingSourceCurrentItemChanged(object sender, System.EventArgs e)
		{
			_currentChuongTrinhChiTiet = uxChuongTrinhChiTietBindingSource.Current as Entities.ChuongTrinhChiTiet;
			
			if (_currentChuongTrinhChiTiet != null)
			{
				_currentChuongTrinhChiTiet.Validate();
			}
			//_ChuongTrinhChiTiet.Validate();
			OnCurrentEntityChanged();
		}

		//void uxChuongTrinhChiTietBindingSource_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e)
		//{
			//throw new Exception("The method or operation is not implemented.");
		//}		
		
		#endregion
		
		/// <summary>
		/// Gets the currently selected <c cref="Entities.ChuongTrinhChiTiet"/> instance.
		/// </summary>
		public Entities.ChuongTrinhChiTiet SelectedChuongTrinhChiTiet
		{
			get {return this._currentChuongTrinhChiTiet;}
		}
		
		#region other properties
		
		/// <summary>
		/// Gets or sets a value indicating whether you have provided your own data-management operations for the DataGridView control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool VirtualMode
		{
			get {return this.uxChuongTrinhChiTietDataGridView.VirtualMode;}
			set
			{
				this.uxChuongTrinhChiTietDataGridView.VirtualMode = value;
			}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the option to add rows is displayed to the user.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToAddRows
		{
			get {return this.uxChuongTrinhChiTietDataGridView.AllowUserToAddRows;}
			set {this.uxChuongTrinhChiTietDataGridView.AllowUserToAddRows = value;}
		}
		
		/// <summary>
		/// Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public bool AllowUserToDeleteRows
		{
			get {return this.uxChuongTrinhChiTietDataGridView.AllowUserToDeleteRows;}
			set {this.uxChuongTrinhChiTietDataGridView.AllowUserToDeleteRows = value;}
		}
		
		/// <summary>
		/// Gets the <c cref="DataGridView"/> instance.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]
		public System.Windows.Forms.DataGridView DataGridView
		{
			get {return this.uxChuongTrinhChiTietDataGridView;}
		}
		
		/// <summary>
		/// Gets a collection that contains all the columns in the control.
		/// </summary>
		[System.ComponentModel.Category(".netTiers")]		
		[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
		//[System.ComponentModel.EditorAttribute("System.Windows.Forms.Design.DataGridViewColumnCollectionEditor, System.Design", typeof(System.Drawing.Design.UITypeEditor))] 
		public System.Windows.Forms.DataGridViewColumnCollection Columns
		{
			get { return this.uxChuongTrinhChiTietDataGridView.Columns; }
		}
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;
	
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	
		#region Constructor
	
		/// <summary>
		/// Initializes a new instance of the <see cref="ChuongTrinhChiTietDataGridViewBase"/> class.
		/// </summary>
		public ChuongTrinhChiTietDataGridViewBase()
		{			
			this.components = new System.ComponentModel.Container();			
			
			this.uxChuongTrinhChiTietDataGridView = new System.Windows.Forms.DataGridView();
			this.uxChuongTrinhChiTietBindingSource = new System.Windows.Forms.BindingSource(this.components);
			this.uxChuongTrinhChiTietErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxChiTietIdDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxLoaiThoiGianIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxSoThoiGianDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxDoanhSoDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxChuongTrinhIdDataGridViewColumn = new System.Windows.Forms.DataGridViewComboBoxColumn();
			this.uxLastUpdateDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			this.uxUpdateByDataGridViewColumn = new System.Windows.Forms.DataGridViewTextBoxColumn();
			//this.uxChuongTrinhIdBindingSource = new ChuongTrinhBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhIdBindingSource)).BeginInit();
			//this.uxLoaiThoiGianIdBindingSource = new LoaiThoiGianBindingSource(this.components);
			//((System.ComponentModel.ISupportInitialize)(this.uxLoaiThoiGianIdBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietDataGridView)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietErrorProvider)).BeginInit();
			this.SuspendLayout();
						
			// 
			// uxChuongTrinhChiTietErrorProvider
			// 
			this.uxChuongTrinhChiTietErrorProvider.ContainerControl = this;
			this.uxChuongTrinhChiTietErrorProvider.DataSource = this.uxChuongTrinhChiTietBindingSource;						
			// 
			// uxChuongTrinhChiTietDataGridView
			// 
			this.uxChuongTrinhChiTietDataGridView.AutoGenerateColumns = false;
			this.uxChuongTrinhChiTietDataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
			this.uxChuongTrinhChiTietDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
		this.uxChiTietIdDataGridViewColumn,
		this.uxLoaiThoiGianIdDataGridViewColumn,
		this.uxSoThoiGianDataGridViewColumn,
		this.uxDoanhSoDataGridViewColumn,
		this.uxChuongTrinhIdDataGridViewColumn,
		this.uxLastUpdateDataGridViewColumn,
		this.uxUpdateByDataGridViewColumn			});
			this.uxChuongTrinhChiTietDataGridView.Dock = System.Windows.Forms.DockStyle.Fill;
			this.uxChuongTrinhChiTietDataGridView.Location = new System.Drawing.Point(0, 0);
			this.uxChuongTrinhChiTietDataGridView.Name = "uxChuongTrinhChiTietDataGridView";
			this.uxChuongTrinhChiTietDataGridView.Size = new System.Drawing.Size(470, 300);
			this.uxChuongTrinhChiTietDataGridView.TabIndex = 0;	
			this.uxChuongTrinhChiTietDataGridView.BackgroundColor = System.Drawing.Color.WhiteSmoke;
			this.uxChuongTrinhChiTietDataGridView.EnableHeadersVisualStyles = false;
			this.uxChuongTrinhChiTietDataGridView.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.OnChuongTrinhChiTietDataGridViewDataError);
			this.uxChuongTrinhChiTietDataGridView.CellValueNeeded += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChuongTrinhChiTietDataGridViewCellValueNeeded);
			this.uxChuongTrinhChiTietDataGridView.CellValuePushed += new System.Windows.Forms.DataGridViewCellValueEventHandler(this.OnChuongTrinhChiTietDataGridViewCellValuePushed);
			
			//
			// uxChiTietIdDataGridViewColumn
			//
			this.uxChiTietIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChiTietIdDataGridViewColumn.DataPropertyName = "ChiTietId";
			this.uxChiTietIdDataGridViewColumn.HeaderText = "ChiTietId";
			this.uxChiTietIdDataGridViewColumn.Name = "uxChiTietIdDataGridViewColumn";
			this.uxChiTietIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChiTietIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChiTietIdDataGridViewColumn.ReadOnly = true;		
			//
			// uxLoaiThoiGianIdDataGridViewColumn
			//
			this.uxLoaiThoiGianIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLoaiThoiGianIdDataGridViewColumn.DataPropertyName = "LoaiThoiGianId";
			this.uxLoaiThoiGianIdDataGridViewColumn.HeaderText = "LoaiThoiGianId";
			this.uxLoaiThoiGianIdDataGridViewColumn.Name = "uxLoaiThoiGianIdDataGridViewColumn";
			this.uxLoaiThoiGianIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLoaiThoiGianIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLoaiThoiGianIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxSoThoiGianDataGridViewColumn
			//
			this.uxSoThoiGianDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxSoThoiGianDataGridViewColumn.DataPropertyName = "SoThoiGian";
			this.uxSoThoiGianDataGridViewColumn.HeaderText = "SoThoiGian";
			this.uxSoThoiGianDataGridViewColumn.Name = "uxSoThoiGianDataGridViewColumn";
			this.uxSoThoiGianDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxSoThoiGianDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxSoThoiGianDataGridViewColumn.ReadOnly = false;		
			//
			// uxDoanhSoDataGridViewColumn
			//
			this.uxDoanhSoDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxDoanhSoDataGridViewColumn.DataPropertyName = "DoanhSo";
			this.uxDoanhSoDataGridViewColumn.HeaderText = "DoanhSo";
			this.uxDoanhSoDataGridViewColumn.Name = "uxDoanhSoDataGridViewColumn";
			this.uxDoanhSoDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxDoanhSoDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxDoanhSoDataGridViewColumn.ReadOnly = false;		
			//
			// uxChuongTrinhIdDataGridViewColumn
			//
			this.uxChuongTrinhIdDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxChuongTrinhIdDataGridViewColumn.DataPropertyName = "ChuongTrinhId";
			this.uxChuongTrinhIdDataGridViewColumn.HeaderText = "ChuongTrinhId";
			this.uxChuongTrinhIdDataGridViewColumn.Name = "uxChuongTrinhIdDataGridViewColumn";
			this.uxChuongTrinhIdDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxChuongTrinhIdDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxChuongTrinhIdDataGridViewColumn.ReadOnly = false;		
			//
			// uxLastUpdateDataGridViewColumn
			//
			this.uxLastUpdateDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxLastUpdateDataGridViewColumn.DataPropertyName = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.HeaderText = "LastUpdate";
			this.uxLastUpdateDataGridViewColumn.Name = "uxLastUpdateDataGridViewColumn";
			this.uxLastUpdateDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxLastUpdateDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxLastUpdateDataGridViewColumn.ReadOnly = false;		
			//
			// uxUpdateByDataGridViewColumn
			//
			this.uxUpdateByDataGridViewColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
			this.uxUpdateByDataGridViewColumn.DataPropertyName = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.HeaderText = "UpdateBy";
			this.uxUpdateByDataGridViewColumn.Name = "uxUpdateByDataGridViewColumn";
			this.uxUpdateByDataGridViewColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True;
			this.uxUpdateByDataGridViewColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
			this.uxUpdateByDataGridViewColumn.ReadOnly = false;		
			//
			// uxChuongTrinhIdDataGridViewColumn
			//				
			this.uxChuongTrinhIdDataGridViewColumn.DisplayMember = "TenChuongTrinh";	
			this.uxChuongTrinhIdDataGridViewColumn.ValueMember = "ChuongTrinhId";	
			this.uxChuongTrinhIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxChuongTrinhIdDataGridViewColumn.DataSource = uxChuongTrinhIdBindingSource;				
				
			//
			// uxLoaiThoiGianIdDataGridViewColumn
			//				
			this.uxLoaiThoiGianIdDataGridViewColumn.DisplayMember = "TenLoaiThoiGian";	
			this.uxLoaiThoiGianIdDataGridViewColumn.ValueMember = "LoaiThoiGianId";	
			this.uxLoaiThoiGianIdDataGridViewColumn.DisplayStyleForCurrentCellOnly = true;
			//uxLoaiThoiGianIdDataGridViewColumn.DataSource = uxLoaiThoiGianIdBindingSource;				
				
			
			// this
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Controls.Add(this.uxChuongTrinhChiTietDataGridView);
			this.Name = "ChuongTrinhChiTietDataGridView";
			this.Size = new System.Drawing.Size(470, 300);
			//((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhIdBindingSource)).EndInit();
			//((System.ComponentModel.ISupportInitialize)(this.uxLoaiThoiGianIdBindingSource)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietDataGridView)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxChuongTrinhChiTietBindingSource)).EndInit();
			this.ResumeLayout(false);
		}
		#endregion
				
		#region events
		
		/// <summary>
		/// Raised the CurrentEntityChanged event.
		/// </summary>
		protected void OnCurrentEntityChanged()
		{
			if (CurrentEntityChanged != null)
			{
				ChuongTrinhChiTietDataGridViewEventArgs args = new ChuongTrinhChiTietDataGridViewEventArgs();
				args.ChuongTrinhChiTiet = _currentChuongTrinhChiTiet;
				CurrentEntityChanged(this, args); 
			}
		}
		
		#endregion
		
		/// <summary>
		/// Strongly typed event 
		/// </summary>
		public class ChuongTrinhChiTietDataGridViewEventArgs : System.EventArgs
		{
			private Entities.ChuongTrinhChiTiet	_ChuongTrinhChiTiet;
	
			/// <summary>
			/// the  Entities.ChuongTrinhChiTiet instance.
			/// </summary>
			public Entities.ChuongTrinhChiTiet ChuongTrinhChiTiet
			{
				get { return _ChuongTrinhChiTiet; }
				set { _ChuongTrinhChiTiet = value; }
			}	
		}
		
		/// <summary>
		/// Handles the DataError event of the uxChuongTrinhChiTietDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewDataErrorEventArgs"/> instance containing the event data.</param>
		protected void OnChuongTrinhChiTietDataGridViewDataError(object sender, System.Windows.Forms.DataGridViewDataErrorEventArgs e)
		{
			System.Diagnostics.Debug.WriteLine(string.Format( "{0}, {1}", e.ColumnIndex, e.RowIndex));
		}
		
		/// <summary>
		/// Handles the CellValueNeeded event of the uxChuongTrinhChiTietDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChuongTrinhChiTietDataGridViewCellValueNeeded(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChuongTrinhChiTietDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChiTietIdDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].ChiTietId;
						break;
					case "uxLoaiThoiGianIdDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].LoaiThoiGianId;
						break;
					case "uxSoThoiGianDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].SoThoiGian;
						break;
					case "uxDoanhSoDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].DoanhSo;
						break;
					case "uxChuongTrinhIdDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].ChuongTrinhId;
						break;
					case "uxLastUpdateDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].LastUpdate;
						break;
					case "uxUpdateByDataGridViewColumn":
						e.Value = ChuongTrinhChiTietList[e.RowIndex].UpdateBy;
						break;
				default:
				break;
			}
		}
		
		/// <summary>
		/// Handles the CellValuePushed event of the uxChuongTrinhChiTietDataGridView control.
		/// </summary>
		/// <param name="sender">The source of the event.</param>
		/// <param name="e">The <see cref="T:System.Windows.Forms.DataGridViewCellValueEventArgs"/> instance containing the event data.</param>
		protected void OnChuongTrinhChiTietDataGridViewCellValuePushed(object sender, System.Windows.Forms.DataGridViewCellValueEventArgs e)
		{
			switch(uxChuongTrinhChiTietDataGridView.Columns[e.ColumnIndex].Name)
			{
					case "uxChiTietIdDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].ChiTietId = (System.Int32)e.Value;
						break;
					case "uxLoaiThoiGianIdDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].LoaiThoiGianId = (System.Byte)e.Value;
						break;
					case "uxSoThoiGianDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].SoThoiGian = (System.Byte)e.Value;
						break;
					case "uxDoanhSoDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].DoanhSo = (System.Int32)e.Value;
						break;
					case "uxChuongTrinhIdDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].ChuongTrinhId = (System.Int32)e.Value;
						break;
					case "uxLastUpdateDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].LastUpdate = (System.DateTime)e.Value;
						break;
					case "uxUpdateByDataGridViewColumn":
						ChuongTrinhChiTietList[e.RowIndex].UpdateBy = (System.Int32)e.Value;
						break;
				default:
				break;
			}
		}
	}
}
